<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content=
    "application/xhtml+xml; charset=iso-8859-1" />
    <title>
      6.19.&nbsp;Bzip2-1.0.6
    </title>
    <link rel="stylesheet" href="../stylesheets/lfs.css" type="text/css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
    <link rel="stylesheet" href="../stylesheets/lfs-print.css" type=
    "text/css" media="print" />
  </head>
  <body class="lfs" id="lfs-7.3">
    <div class="navheader">
      <h4>
        Linux From Scratch - Version 7.3
      </h4>
      <h3>
        Chapter&nbsp;6.&nbsp;Installing Basic System Software
      </h3>
      <ul>
        <li class="prev">
          <a accesskey="p" href="sed.html" title="Sed-4.2.2">Prev</a>
          <p>
            Sed-4.2.2
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="pkg-config.html" title=
          "Pkg-config-0.28">Next</a>
          <p>
            Pkg-config-0.28
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="chapter06.html" title=
          "Chapter&nbsp;6.&nbsp;Installing Basic System Software">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Linux From Scratch - Version 7.3">Home</a>
        </li>
      </ul>
    </div>
    <div class="wrap" lang="en" xml:lang="en">
      <h1 class="sect1">
        <a id="ch-system-bzip2" name="ch-system-bzip2"></a>6.19. Bzip2-1.0.6
      </h1>
      <div class="package" lang="en" xml:lang="en">
        <p>
          The Bzip2 package contains programs for compressing and
          decompressing files. Compressing text files with <span class=
          "command"><strong>bzip2</strong></span> yields a much better
          compression percentage than with the traditional <span class=
          "command"><strong>gzip</strong></span>.
        </p>
        <div class="segmentedlist">
          <div class="seglistitem">
            <div class="seg">
              <strong class="segtitle">Approximate build time:</strong>
              <span class="segbody">less than 0.1 SBU</span>
            </div>
            <div class="seg">
              <strong class="segtitle">Required disk space:</strong>
              <span class="segbody">6.9 MB</span>
            </div>
          </div>
        </div>
      </div>
      <div class="installation" lang="en" xml:lang="en">
        <h2 class="sect2">
          6.19.1. Installation of Bzip2
        </h2>
        <p>
          Apply a patch that will install the documentation for this package:
        </p>
        <pre class="userinput">
<kbd class="command">patch -Np1 -i ../bzip2-1.0.6-install_docs-1.patch</kbd>
</pre>
        <p>
          The following command ensures installation of symbolic links are
          relative:
        </p>
        <pre class="userinput">
<kbd class=
"command">sed -i 's@\(ln -s -f \)$(PREFIX)/bin/@\1@' Makefile</kbd>
</pre>
        <p>
          Ensure the man pages are installed into the correct location:
        </p>
        <pre class="userinput">
<kbd class=
"command">sed -i "s@(PREFIX)/man@(PREFIX)/share/man@g" Makefile</kbd>
</pre>
        <p>
          Prepare Bzip2 for compilation with:
        </p>
        <pre class="userinput">
<kbd class="command">make -f Makefile-libbz2_so
make clean</kbd>
</pre>
        <div class="variablelist">
          <p class="title">
            <b>The meaning of the make parameter:</b>
          </p>
          <dl>
            <dt>
              <span class="term"><em class="parameter"><code>-f
              Makefile-libbz2_so</code></em></span>
            </dt>
            <dd>
              <p>
                This will cause Bzip2 to be built using a different
                <code class="filename">Makefile</code> file, in this case the
                <code class="filename">Makefile-libbz2_so</code> file, which
                creates a dynamic <code class="filename">libbz2.so</code>
                library and links the Bzip2 utilities against it.
              </p>
            </dd>
          </dl>
        </div>
        <p>
          Compile and test the package:
        </p>
        <pre class="userinput">
<kbd class="command">make</kbd>
</pre>
        <p>
          Install the programs:
        </p>
        <pre class="userinput">
<kbd class="command">make PREFIX=/usr install</kbd>
</pre>
        <p>
          Install the shared <span class=
          "command"><strong>bzip2</strong></span> binary into the
          <code class="filename">/bin</code> directory, make some necessary
          symbolic links, and clean up:
        </p>
        <pre class="userinput">
<kbd class="command">cp -v bzip2-shared /bin/bzip2
cp -av libbz2.so* /lib
ln -sv ../../lib/libbz2.so.1.0 /usr/lib/libbz2.so
rm -v /usr/bin/{bunzip2,bzcat,bzip2}
ln -sv bzip2 /bin/bunzip2
ln -sv bzip2 /bin/bzcat</kbd>
</pre>
      </div>
      <div class="content" lang="en" xml:lang="en">
        <h2 class="sect2">
          <a id="contents-bzip2" name="contents-bzip2"></a>6.19.2. Contents
          of Bzip2
        </h2>
        <div class="segmentedlist">
          <div class="seglistitem">
            <div class="seg">
              <strong class="segtitle">Installed programs:</strong>
              <span class="segbody">bunzip2 (link to bzip2), bzcat (link to
              bzip2), bzcmp (link to bzdiff), bzdiff, bzegrep (link to
              bzgrep), bzfgrep (link to bzgrep), bzgrep, bzip2, bzip2recover,
              bzless (link to bzmore), and bzmore</span>
            </div>
            <div class="seg">
              <strong class="segtitle">Installed libraries:</strong>
              <span class="segbody">libbz2.{a,so}</span>
            </div>
            <div class="seg">
              <strong class="segtitle">Installed directory:</strong>
              <span class="segbody">/usr/share/doc/bzip2-1.0.6</span>
            </div>
          </div>
        </div>
        <div class="variablelist">
          <h3>
            Short Descriptions
          </h3>
          <table border="0">
            <col align="left" valign="top" />
            <tbody>
              <tr>
                <td>
                  <p>
                    <a id="bunzip2" name="bunzip2"></a><span class=
                    "term"><span class=
                    "command"><strong>bunzip2</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    Decompresses bzipped files
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="bzcat" name="bzcat"></a><span class=
                    "term"><span class=
                    "command"><strong>bzcat</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    Decompresses to standard output
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="bzcmp" name="bzcmp"></a><span class=
                    "term"><span class=
                    "command"><strong>bzcmp</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    Runs <span class="command"><strong>cmp</strong></span> on
                    bzipped files
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="bzdiff" name="bzdiff"></a><span class=
                    "term"><span class=
                    "command"><strong>bzdiff</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    Runs <span class="command"><strong>diff</strong></span>
                    on bzipped files
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="bzegrep" name="bzegrep"></a><span class=
                    "term"><span class=
                    "command"><strong>bzegrep</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    Runs <span class="command"><strong>egrep</strong></span>
                    on bzipped files
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="bzfgrep" name="bzfgrep"></a><span class=
                    "term"><span class=
                    "command"><strong>bzfgrep</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    Runs <span class="command"><strong>fgrep</strong></span>
                    on bzipped files
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="bzgrep" name="bzgrep"></a><span class=
                    "term"><span class=
                    "command"><strong>bzgrep</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    Runs <span class="command"><strong>grep</strong></span>
                    on bzipped files
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="bzip2" name="bzip2"></a><span class=
                    "term"><span class=
                    "command"><strong>bzip2</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    Compresses files using the Burrows-Wheeler block sorting
                    text compression algorithm with Huffman coding; the
                    compression rate is better than that achieved by more
                    conventional compressors using &ldquo;<span class=
                    "quote">Lempel-Ziv</span>&rdquo; algorithms, like
                    <span class="command"><strong>gzip</strong></span>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="bzip2recover" name="bzip2recover"></a><span class=
                    "term"><span class=
                    "command"><strong>bzip2recover</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    Tries to recover data from damaged bzipped files
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="bzless" name="bzless"></a><span class=
                    "term"><span class=
                    "command"><strong>bzless</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    Runs <span class="command"><strong>less</strong></span>
                    on bzipped files
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="bzmore" name="bzmore"></a><span class=
                    "term"><span class=
                    "command"><strong>bzmore</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    Runs <span class="command"><strong>more</strong></span>
                    on bzipped files
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="libbz2" name="libbz2"></a><span class=
                    "term"><code class="filename">libbz2*</code></span>
                  </p>
                </td>
                <td>
                  <p>
                    The library implementing lossless, block-sorting data
                    compression, using the Burrows-Wheeler algorithm
                  </p>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
    </div>
    <div class="navfooter">
      <ul>
        <li class="prev">
          <a accesskey="p" href="sed.html" title="Sed-4.2.2">Prev</a>
          <p>
            Sed-4.2.2
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="pkg-config.html" title=
          "Pkg-config-0.28">Next</a>
          <p>
            Pkg-config-0.28
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="chapter06.html" title=
          "Chapter&nbsp;6.&nbsp;Installing Basic System Software">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Linux From Scratch - Version 7.3">Home</a>
        </li>
      </ul>
    </div>
  </body>
</html>
